home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / cxref_1_4a.lha / cxref.h < prev    next >
C/C++ Source or Header  |  1997-06-19  |  6KB  |  209 lines

  1. /***************************************
  2.   $Header: /home/amb/cxref/RCS/cxref.h 1.24 1997/06/19 17:39:32 amb Exp $
  3.  
  4.   C Cross Referencing & Documentation tool. Version 1.4.
  5.  
  6.   Prototypes for general functions.
  7.   ******************/ /******************
  8.   Written by Andrew M. Bishop
  9.  
  10.   This file Copyright 1995,96,97 Andrew M. Bishop
  11.   It may be distributed under the GNU Public License, version 2, or
  12.   any higher version.  See section COPYING of the GNU Public license
  13.   for conditions under which this file may be redistributed.
  14.   ***************************************/
  15.  
  16.  
  17. #ifndef CXREF_H
  18. #define CXREF_H  /*+ To stop multiple inclusions. +*/
  19.  
  20. #include <stdio.h>
  21.  
  22. /* Definitions for variable / function / file types */
  23.  
  24. #define LOCAL     1      /*+ Signifies a LOCAL function / variable / include file. +*/
  25. #define GLOBAL    2      /*+ Signifies a GLOBAL fuction / variable / include file. +*/
  26. #define EXTERNAL  4      /*+ Signifies an EXTERNAL variable. +*/
  27. #define EXTERN_H  8      /*+ Signifies an EXTERNAL variable seen in a header file. +*/
  28. #define EXTERN_F 16      /*+ Signifies an EXTERNAL variable seen in a function file. +*/
  29. #define INLINED  32      /*+ Signifies an INLINED function. +*/
  30.  
  31. /* Definitions for -xref options */
  32.  
  33. #define XREF_FILE   1    /*+ Signifies that file cross references are required. +*/
  34. #define XREF_FUNC   2    /*+ Signifies that function cross references are required. +*/
  35. #define XREF_VAR    4    /*+ Signifies that variable cross references are required. +*/
  36. #define XREF_TYPE   8    /*+ Signifies that type definition cross references are required. +*/
  37. #define XREF_ALL   15    /*+ Signifies that all the above cross references are required. +*/
  38.  
  39. /* Definitions for -warn options */
  40.  
  41. #define WARN_COMMENT  1  /*+ Signifies that warnings for commetns are required. +*/
  42. #define WARN_XREF     2  /*+ Signifies that warnings for cross references are required. +*/
  43. #define WARN_ALL      3  /*+ Signifies that all of the above warnings are required. +*/
  44.  
  45. /* Definitions for -index options */
  46.  
  47. #define INDEX_FILE   1   /*+ Signifies that an index of files is needed. +*/
  48. #define INDEX_FUNC   2   /*+ Signifies that an index of global functions is needed. +*/
  49. #define INDEX_VAR    3   /*+ Signifies that an index of global variables is needed. +*/
  50. #define INDEX_TYPE   4   /*+ Signifies that an index of type definitions is needed. +*/
  51. #define INDEX_ALL   15   /*+ Signifies that a complete index of all of the above is needed. +*/
  52.  
  53. /* in cxref.c */
  54.  
  55. char *CanonicaliseName(char *name);
  56.  
  57. /* In parse.l */
  58.  
  59. void ResetLexer(void);
  60.  
  61. /* In parse.y */
  62.  
  63. void ResetParser(void);
  64.  
  65. /* in file.c */
  66.  
  67. #ifdef DATA_TYPE_H
  68. File NewFile(char* name);
  69. void DeleteFile(File file);
  70. #endif
  71.  
  72. void SeenFileComment(char* comment);
  73.  
  74. /* in comment.c */
  75.  
  76. void SeenComment(char* c);
  77. char* GetCurrentComment(void);
  78. void SetCurrentComment(char* comment);
  79. char* SplitComment(char** original,char* name);
  80.  
  81. /* in preproc.c */
  82.  
  83. void SeenInclude(char *name);
  84. void SeenIncludeComment(void);
  85. void SeenFileChange(char *name,int flag);
  86.  
  87. void SeenDefine(char* name);
  88. void SeenDefineComment(void);
  89. void SeenDefineValue(char* value);
  90. void SeenDefineFunctionArg(char* name);
  91. void SeenDefineFuncArgComment(void);
  92.  
  93. void ResetPreProcAnalyser(void);
  94. #ifdef DATA_TYPE_H
  95. void DeleteIncludeType(Include inc);
  96. void DeleteDefineType(Define inc);
  97. #endif
  98.  
  99. /* in type.c */
  100.  
  101. void SeenTypedefName(char* name,int what_type);
  102. int IsATypeName(char* name);
  103. void SeenTypedef(char* name,char* type);
  104.  
  105. void SeenStructUnionStart(char* name);
  106. void SeenStructUnionComp(char* name,int depth);
  107. void SeenStructUnionEnd(void);
  108.  
  109. void ResetTypeAnalyser(void);
  110. #ifdef DATA_TYPE_H
  111. void DeleteTypedefType(Typedef type);
  112. #endif
  113.  
  114. /* in var.c */
  115.  
  116. void SeenVariableDefinition(char* name,char* type,int scope);
  117.  
  118. void UpScope(void);
  119. void DownScope(void);
  120. void SeenScopeVariable(char* name);
  121. int IsAScopeVariable(char* name);
  122.  
  123. void ResetVariableAnalyser(void);
  124. #ifdef DATA_TYPE_H
  125. void DeleteVariableType(Variable var);
  126. #endif
  127.  
  128. /* in func.c */
  129.  
  130. void SeenFunctionProto(char* name,int in_a_function);
  131.  
  132. void SeenFunctionDeclaration(char* name,int scope);
  133. void SeenFunctionDefinition(char* type);
  134. void SeenFunctionArg(char* name,char* type);
  135.  
  136. void SeenFunctionCall(char* name);
  137. void CheckFunctionVariableRef(char* name,int in_a_function);
  138.  
  139. int SeenFuncIntComment(char* comment);
  140.  
  141. void ResetFunctionAnalyser(void);
  142. #ifdef DATA_TYPE_H
  143. void DeleteFunctionType(Function func);
  144. #endif
  145.  
  146. /* In slist.c */
  147.  
  148. #ifdef DATA_TYPE_H
  149. StringList NewStringList(void);
  150. void AddToStringList(StringList sl,char* str,int alphalist,int uniqlist);
  151. void DeleteStringList(StringList sl);
  152.  
  153. StringList2 NewStringList2(void);
  154. void AddToStringList2(StringList2 sl,char* str1,char* str2,int alphalist,int uniqlist);
  155. void DeleteStringList2(StringList2 sl);
  156. #endif
  157.  
  158. /* In xref.c */
  159.  
  160. #ifdef DATA_TYPE_H
  161. void CrossReference(File file);
  162. void CreateAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
  163. #endif
  164.  
  165. void CrossReferenceDelete(char *name);
  166.  
  167. /* In warn-raw.c */
  168.  
  169. #ifdef DATA_TYPE_H
  170. void WriteWarnRawFile(File file);
  171. void WriteWarnRawAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
  172. #endif
  173.  
  174. /* In latex.c */
  175.  
  176. #ifdef DATA_TYPE_H
  177. void WriteLatexFile(File file);
  178. void WriteLatexAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
  179. #endif
  180.  
  181. void WriteLatexFileDelete(char *name);
  182.  
  183. /* In html.c */
  184.  
  185. #ifdef DATA_TYPE_H
  186. void WriteHTMLFile(File file);
  187. void WriteHTMLAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
  188. #endif
  189.  
  190. void WriteHTMLFileDelete(char *name);
  191.  
  192. /* Not defined on Suns */
  193.  
  194. #if defined(__sun__) && !defined(__svr4__)
  195. int fputs(const char *s, FILE *stream);
  196. int fprintf(FILE*, const char*,...);
  197. int pclose( FILE *stream);
  198. int fscanf( FILE *stream, const char *format, ...);
  199. int fclose(FILE*);
  200. int rename(const char *oldpath, const char *newpath);
  201. int printf(const char*,...);
  202. int fwrite(const void*,unsigned int,unsigned int, FILE*);
  203. int fread(void*,unsigned int,unsigned int, FILE*);
  204. int isatty(int desc);
  205. int fflush( FILE *stream);
  206. #endif
  207.  
  208. #endif /* CXREF_H */
  209.